import instance from '@/http/index'
import type {changeCompanyForm} from './type.ts'
//统一管理接口
enum API {
    GETALLSWIPER_URL = '/set/getAllSwiper',
    GETCOMPANYNAME_URL = '/set/getCompanyName',
    CHANGECOMPANYNAME_URL = '/set/changeCompanyName',
    CHANGECOMPANYINTRODUCE_URL = '/set/changeCompanyIntroduce',
    GETCOMPANYINTRODUCE_URL = '/set/getCompanyIntroduce',
    GETALLCOMPANYINTRODUCE = '/set/getAllCompanyIntroduce',
    SETDEPARTMENT_URL = '/set/setDepartment',
    GETDETDEPARTMENT_URL = '/set/getDepartment',
    SETPRODUCT_URL = '/set/setProduct',
    GETPRODUCT_URL = '/set/getProduct'
}

//获取所有轮播图
export const getAllSwiper = ()=>{
    return instance.post(API.GETALLSWIPER_URL)
}
//获取公司名称
export const getCompanyName = ()=>{
    return instance.post(API.GETCOMPANYNAME_URL)
}
//修改公司名字 
export const changeCompanyName = (set_value:string)=>{
    return instance.post(API.CHANGECOMPANYNAME_URL,{set_value})
}

// 编辑公司介绍接口 set_text set_name
export const changeCompanyIntroduce = (data:changeCompanyForm)=>{
    return instance.post(API.CHANGECOMPANYINTRODUCE_URL,data)
}

//获取公司介绍
export const getCompanyIntroduce = (set_name:string)=>{
    return instance.post(API.GETCOMPANYINTRODUCE_URL,{set_name})
}

//获取所有公司信息
export const getAllCompanyIntroduce = ()=>{
    return instance.post(API.GETALLCOMPANYINTRODUCE)
}

//部门设置
export const setDepartment = (data:any)=>{
    return instance.post(API.SETDEPARTMENT_URL,{set_value:data})
}
//获取部门
export const getDepartment = ()=>{
    return instance.post(API.GETDETDEPARTMENT_URL)
}
//产品设置
export const setProduct = (data:any)=>{
    return instance.post(API.SETPRODUCT_URL,{set_value:data})
}
//获取产品
export const getProduct = ()=>{
    return instance.post(API.GETPRODUCT_URL)
}